<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>ReflectionFunction 类</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reflectionextension.tostring.html">ReflectionExtension::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reflectionfunction.construct.html">ReflectionFunction::__construct</a></div>
 <div class="up"><a href="book.reflection.html">反射</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.reflectionfunction" class="reference">

 <h1 class="title">ReflectionFunction 类</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5)</p>


  <div class="section" id="reflectionfunction.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    <strong class="classname">ReflectionFunction</strong> 类报告了一个函数的有关信息。
   </p>
  </div>


  <div class="section" id="reflectionfunction.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">ReflectionFunction</strong>
     </span>
     
     <span class="ooclass">
      <span class="modifier">extends</span>
      <a href="class.reflectionfunctionabstract.html" class="classname">ReflectionFunctionAbstract</a>
     </span>
     
     <span class="oointerface">implements 
      <span class="interfacename"><a href="class.reflector.html" class="interfacename">Reflector</a></span>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionfunction.html#reflectionfunction.constants.is-deprecated"><var class="varname">IS_DEPRECATED</var></a></var>
     <span class="initializer"> = 262144</span>
    ;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.reflectionfunction.html#reflectionfunction.props.name">$<var class="varname">name</var></a></var>
    ;</div>


    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="reflectionfunction.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunction.export.html" class="methodname">export</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$return</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">Closure</span><span class="methodname"><a href="reflectionfunction.getclosure.html" class="methodname">getClosure</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="reflectionfunction.invoke.html" class="methodname">invoke</a></span>
    ([ <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$parameter</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$...</code></span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="reflectionfunction.invokeargs.html" class="methodname">invokeArgs</a></span>
    ( <span class="methodparam"><span class="type">array</span> <code class="parameter">$args</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunction.isdisabled.html" class="methodname">isDisabled</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunction.tostring.html" class="methodname">__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">private</span> <span class="type">void</span><span class="methodname"><a href="reflectionfunctionabstract.clone.html" class="methodname">ReflectionFunctionAbstract::__clone</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionClass</span><span class="methodname"><a href="reflectionfunctionabstract.getclosurescopeclass.html" class="methodname">ReflectionFunctionAbstract::getClosureScopeClass</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">object</span><span class="methodname"><a href="reflectionfunctionabstract.getclosurethis.html" class="methodname">ReflectionFunctionAbstract::getClosureThis</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getdoccomment.html" class="methodname">ReflectionFunctionAbstract::getDocComment</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionfunctionabstract.getendline.html" class="methodname">ReflectionFunctionAbstract::getEndLine</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionExtension</span><span class="methodname"><a href="reflectionfunctionabstract.getextension.html" class="methodname">ReflectionFunctionAbstract::getExtension</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getextensionname.html" class="methodname">ReflectionFunctionAbstract::getExtensionName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getfilename.html" class="methodname">ReflectionFunctionAbstract::getFileName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getname.html" class="methodname">ReflectionFunctionAbstract::getName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getnamespacename.html" class="methodname">ReflectionFunctionAbstract::getNamespaceName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionfunctionabstract.getnumberofparameters.html" class="methodname">ReflectionFunctionAbstract::getNumberOfParameters</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionfunctionabstract.getnumberofrequiredparameters.html" class="methodname">ReflectionFunctionAbstract::getNumberOfRequiredParameters</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionfunctionabstract.getparameters.html" class="methodname">ReflectionFunctionAbstract::getParameters</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getshortname.html" class="methodname">ReflectionFunctionAbstract::getShortName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionfunctionabstract.getstartline.html" class="methodname">ReflectionFunctionAbstract::getStartLine</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionfunctionabstract.getstaticvariables.html" class="methodname">ReflectionFunctionAbstract::getStaticVariables</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.innamespace.html" class="methodname">ReflectionFunctionAbstract::inNamespace</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.isclosure.html" class="methodname">ReflectionFunctionAbstract::isClosure</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.isdeprecated.html" class="methodname">ReflectionFunctionAbstract::isDeprecated</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.isgenerator.html" class="methodname">ReflectionFunctionAbstract::isGenerator</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.isinternal.html" class="methodname">ReflectionFunctionAbstract::isInternal</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.isuserdefined.html" class="methodname">ReflectionFunctionAbstract::isUserDefined</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.returnsreference.html" class="methodname">ReflectionFunctionAbstract::returnsReference</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="reflectionfunctionabstract.tostring.html" class="methodname">ReflectionFunctionAbstract::__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>


   }</div>


  </div>

  

  <div class="section" id="reflectionfunction.props">
   <h2 class="title">属性</h2>
   <dl>

    
     <dt id="reflectionfunction.props.name"><var class="varname"><var class="varname">name</var></var></dt>

     <dd>

      <p class="para">
       函数的名称。只读，并在尝试赋值的时候会抛出 <a href="class.reflectionexception.html" class="classname">ReflectionException</a>。
      </p>
     </dd>

    
   </dl>

  </div>


  

  <div class="section" id="reflectionfunction.constants">
   <h2 class="title">预定义常量</h2>
   <div class="section" id="reflectionfunction.constants.modifiers">
    <h2 class="title">ReflectionFunction 修饰符</h2>
    <dl>


     
      <dt id="reflectionfunction.constants.is-deprecated"><strong><code>ReflectionFunction::IS_DEPRECATED</code></strong></dt>

      <dd>

       <p class="para">
        指示了不建议使用的函数。
       </p>
      </dd>

     

    </dl>

   </div>
  </div>



 </div>

 


















































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="reflectionfunction.construct.html">ReflectionFunction::__construct</a> — Constructs a ReflectionFunction object</li><li><a href="reflectionfunction.export.html">ReflectionFunction::export</a> — Exports function</li><li><a href="reflectionfunction.getclosure.html">ReflectionFunction::getClosure</a> — Returns a dynamically created closure for the function</li><li><a href="reflectionfunction.invoke.html">ReflectionFunction::invoke</a> — Invokes function</li><li><a href="reflectionfunction.invokeargs.html">ReflectionFunction::invokeArgs</a> — Invokes function args</li><li><a href="reflectionfunction.isdisabled.html">ReflectionFunction::isDisabled</a> — Checks if function is disabled</li><li><a href="reflectionfunction.tostring.html">ReflectionFunction::__toString</a> — To string</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reflectionextension.tostring.html">ReflectionExtension::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reflectionfunction.construct.html">ReflectionFunction::__construct</a></div>
 <div class="up"><a href="book.reflection.html">反射</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
